package wuxianshua.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import wuxianshua.dao.GoldMapper;
import wuxianshua.pojo.Gold;

import java.util.Date;
import java.util.Random;
import java.util.UUID;

/**
 * Description:
 * Datetime:    2021/2/20   19:58
 * Author:   jianglei
 */

@Service
public class GoldService {
    @Autowired
    GoldMapper goldMapper;

    public int insetOne(){
        Gold gold = new Gold();
        gold.setBrief("看视频收益");
        gold.setMytime(new Date());
        Random random = new Random();
        gold.setNumber(random.nextInt(100));
        gold.setStatus(0);
        gold.setUserid(UUID.randomUUID().toString().replace("-",""));
        return  goldMapper.insert(gold);
    }
}